/**
 * ISWE.
 * Created on : 18/07/2009
 *
 * Copyright (c) 2009 ISWE.
 * Rafael Noronha de Almeida
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of Rafael Noronha de Almeida
 * ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Rafael.
 */
package br.com.iswe.core.jpa.gae;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.PersistenceException;

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;

/**
 *
 * Description: LocalContainerEntityManagerFactoryBean for use with Google Apps Engine (GAE)
 *
 * @author Rafael Noronha de Almeida
 *
 * @version $Revision: 1.1 $ $Date: 2009/07/20 11:56:23 $
 *
 */
public class EntityManagerFactoryBean extends LocalContainerEntityManagerFactoryBean {
	 
	private String persistenceUnit;

    @Override
    protected EntityManagerFactory createNativeEntityManagerFactory() throws PersistenceException {
        return Persistence.createEntityManagerFactory(persistenceUnit);
    }

    /**
     * Sets the persistence unit name.
     * 
     * @param persistenceUnit
     *            name of the persistence unit
     */
    public void setPersistenceUnit(final String persistenceUnit) {
        this.persistenceUnit = persistenceUnit;
    }

}
